﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Connection.DAL;

namespace SmsSender
{
    public partial class UserForm : Form
    {
        public UserForm()
        {
            InitializeComponent();
        }
        public UserForm(State aState)
        {
            InitializeComponent();
            cmb_domen.SelectedIndex = 0;
            aConnectionToDB=new ConnectionToDB();
            switch ((int)aState)
            {
                case 1001:AddData();break;
                case 1002:EditData();break;
                case 1003:RemoveData();break;
                default:break;
            }
        }

        private ConnectionToDB aConnectionToDB;
        void RemoveData()
        {
            btn_ok.Text = "Удалить";
            btn_ok.Click += remove_Click;
        }
        void EditData()
        {
            btn_ok.Text = "Изменить";
            btn_ok.Click += edit_Click;
        }
        void AddData()
        {
            btn_ok.Text = "Добавить";
            btn_ok.Click += add_Click;
        }

        private void btn_cancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void add_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Add");
        }

        private void edit_Click(object sender, EventArgs e)
        {
            MessageBox.Show("edit");
        }

        private void remove_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Remove");
        }

        private void UserForm_Load(object sender, EventArgs e)
        {
             
        }
    }
}
